package com.example.magichealth;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class MainActivity extends Activity {

//--------------------------------------------------------------------------------------------------------------------------\\	
/**
 * To initialize the Activity
 *  @param view
 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}
//--------------------------------------------------------------------------------------------------------------------------\\	
										//****NAVIGATION IN THE APPLICATION****\\
/**
 * To download the page profile
 * @param view
 */
	public void goToProfile(View view) {
		Intent intent = new Intent(this, Profil.class);
		startActivity(intent);
	}
	
/**
 * To download the page DMP
 * @param view
 */
	public void goToDMP(View view) {
		Intent intent = new Intent(this, DMP.class);
		startActivity(intent);
	}
	
	
/**
 * To download the page Pharmacy
 * @param view
 */
	public void goToPharmacie(View view) {
		Intent intent = new Intent(this, Pharmacie.class);
		startActivity(intent);
	}
	
	
/**
 * To download the page Parameters
 * @param view
 */
	public void goToParametres(View view) {
		Intent intent = new Intent(this, Parametres.class);
		startActivity(intent);
	}
	
	public void goToTraitement(View view) {
		Intent intent = new Intent(this, MesTraitements.class);
		startActivity(intent);
	}
	

	
//--------------------------------------------------------------------------------------------------------------------------\\	
/**
 * Initialize the contents of the Activity's standard options menu.
 */
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.menuprincipal, menu);
		 
	    return super.onCreateOptionsMenu(menu);
	}
	private static int CODE_RETOUR = 1;
	
	public boolean onOptionsItemSelected(MenuItem item) {
		 
	    if(item.getItemId() == R.id.itemOptions) {
	        startActivityForResult(new Intent(this, MesPreferences.class), CODE_RETOUR);
	    }
	 
	    return super.onOptionsItemSelected(item);
	 
	}
	


}
